<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    function draw() {
      var canvas = document.getElementById('canvas')
      if (canvas.getContext) {
        var ctx = canvas.getContext('2d')
        ctx.beginPath()
        // 画圆
        ctx.arc(75, 75, 50, 0, Math.PI * 2, true)  
        // 移动笔触
        ctx.moveTo(110, 75)
        ctx.arc(75, 75, 35, 0, Math.PI, false)
        ctx.moveTo(55, 60)
        ctx.arc(60, 60, 5, 0, Math.PI * 2, true)
        ctx.moveTo(85, 60)
        ctx.arc(90, 60, 5, 0, Math.PI * 2, true)
        // 描边，不会自动闭合路径，若路径没有闭合需要使用ctx.closePath()
        ctx.stroke()
      }
    }
  </script>
</head>
<body onload="draw()">
  <canvas id="canvas" width="150" height="150"></canvas>
</body>
</html>